<template>
  <div>
    手机号： <input type="text" v-model="pasw"><br>
    密码：<input type="text" v-model="mima">

    <button @click="loginss">登录</button>
    <van-button type="primary" @click="add">存储</van-button>
    <van-button type="danger" @click="dele">删除</van-button>

  </div>
</template>

<script setup lang="ts">
import {ref} from "vue";
import {logins} from '../apis/login/login'
import {useUserStore} from '../stores/modules/user'

const pasw = ref<string>('13121228429')
const mima = ref<string>('12345678')
const store = useUserStore()
const loginss = async () => {
  const res = await logins(pasw.value, mima.value)
  console.log(res)
}

const add =()=>{
  store.setUser({
    token: '24qdwre2e',
    id: '1',
    account: '金小子',
    mobile: '13243432535',
    avatar: 'dsfgewrfhfh',
    refreshToken: 'fghjcvjbn'
  })
}
const dele =()=>{
  store.delUser()
}
</script>
<style scoped>
.h {
  font-size: 16px;
}
</style>